<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;


class Card extends Model
{
    use SoftDeletes;
    use HasDateTimeFormatter;
    use HasFactory;



    public $casts = [
        'default' => 'bool'
    ];

    protected $fillable = ['user_id','bank_id', 'number', 'username', 'phone', 'email', 'ifsc'];

    /**
     * 用户
     * @return BelongsTo
     */
    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }

    public function bank(): BelongsTo
    {
        return $this->belongsTo(Bank::class);
    }

}
